var http = require('../http.js')
var app = getApp()
//   查看动态详情

const dtdetail = (id) => {
  var url = 'circle/show'
  return http.getReq(url, {
    circle_id: id,
    latitude: app.globalData.latitude,
    longitude: app.globalData.longitude,
  })
}
//点赞
const like = (circle_id, status) => {
  var url = 'circle/like'
  http.config.isload = false
  console.log(http.config.isload)
  return http.postReq(url, {
    circle_id: circle_id,
    status: status
  })
}
// 微信支付：小程序调起支付数据签名字段获取  pay/get_params
const get_params = (code) => {
  var url = 'pay/get_params'
  return http.getReq(url, {
    js_code: code
  })
}

// 评论动态 circle/comment
const comment = (circle_id, comment) => {
  var url = 'circle/comment'
  http.config.isload = false
  return http.postReq(url, {
    circle_id: circle_id,
    comment: comment
  })
}
// 删除评论 / api / 
const comment_del = (id) => {
  var url = 'circle/comment_del'
  return http.getReq(url, {
    id: id
  })
}
module.exports = {
  dtdetail,
  like,
  get_params,
  comment,
  comment_del,
}